Oculusのチュートリアル「Build Your First VR App」をやる
from VRMで読み込んだキャラクターをpassthroughで出すアプリを作る
感想
出来上がるのはVRアプリではない!酷い
たしかに冒頭には
This tutorial helps you build your first VR app in Unity.
これがmisleadingというか、誇大広告
It’s a basic app, which introduces primary Unity concepts such as 3D objects, components, and build settings.
こっちは正しい
初めてのVRアプリを構築する | Oculus開発者
このチュートリアルは、Unityの基本的な概念やインターフェイスに慣れることを目的としているため、Oculus統合パッケージは使用しません
日本語版だとPlayerControllerが途中で見切れてるので英語で見た方がいい
GameObject.GetComponent
textはLegacyを使う
2021.3だとデフォルトはTextmesh Proになっているが、このチュートリアルはLegacyなやつを使っている
文字列を出すのが難しい
Canvasが大きくなってしまう
Canvasの設定を
Screen space - cameraにしてMain Cameraから10離す
https://gyazo.com/2f08e3e2ace61df967fc06b163c88e5c
fontをこうする
https://gyazo.com/f92849b5e83d461016585cbb1ad4f58b
このようになる
https://gyazo.com/76ae6773219770c9f1642174c511be58
デフォルトのCanvas - overlayだとCanvasは非常に大きく、画面外にある
https://gyazo.com/23f8a8861e24223a1f683cf25c38904d
Canvasの値は自動で決まるらしく自分で変えることはできない
なんで?
When the canvas is set to screen overlay, its size is set to the same resolution as the game window.
So if your window is 1920x1080 pixels, the canvas will be 1920 units long and 1080 units high (hence why it is so massive).
https://forum.unity.com/threads/canvas-is-huge.468163/
https://docs.unity3d.com/ja/2019.4/Manual/com.unity.ugui.html
【Unity】Canvasの大きさをカメラの範囲内に収めるように調節する方法 | Unishar-ユニシャー
ステップアップUnity#6072039c774b170000ac72efあたりを読むと良さそう
あるいはこのあたり https://learn.unity.com/project/creative-core-ui?uv=2020.3
Build and runでエラー
UnityEditor.BuildPlayerWindow+BuildMethodException: Error building Player: Currently selected scripting backend (Mono) is not installed.
Android向けにビルドするとNo Android device connected
https://docs.unity3d.com/ja/2021.2/Manual/TroubleShootingAndroid.html
QuestとMacを接続してQuestを起動し、Quest上に現れるダイアログからUSB debuggingをallowすると実行できる
https://gyazo.com/7db7ab99162eeb240205fb55e4a4a1b8
これは断じてVRアプリではない
公式チュートリアルをなぞってこれになるのは期待値を下回っている
臨場感あふれるインタラクティブなユーザーエクスペリエンスを実現するバーチャルリアリティ(VR)アプリをビルドするには、UnityでVRサポートを有効にする必要があります。https://developer.oculus.com/documentation/unity/unity-conf-settings/
これかな?
XR Plugin Managementをインストール
target deviceにQuest Proがいない
https://gyazo.com/676bf56ee0375972a1e3c4ce48043a9d
https://twitter.com/motoso/status/1587505504427053056
ちょっとVRになった
操作はまだできない。というか球が消えてる
この教材で学ぶのはあきらめた
Git管理してUnity Hubで開いてゲームができることを確かめた